const Router = require('koa-router')
const { auth } = require('../middleware/auth.middleware')
const { validator } = require('../middleware/carts.middleware')
const { add, findAll } = require('../controller/carts.controller')
const router = new Router({ prefix: '/carts' })
// 添加商品到购物车
router.post('/', auth, validator, add)
//购物车列表
router.get('/', findAll)
module.exports = router